package com.gift.common;



public class Const {

    public static  int CITY_NUM = 0;

    public enum  CityEnum{
        PROVINCE(1,"省和直辖市"),
        CITY(2,"城市"),
        COUNTY(3,"区县");

        CityEnum(int code,String value){
            this.code = code;
            this.value = value;
        }

        private String value;
        private int code;

        public String getValue() {
            return value;
        }

        public int getCode() {
            return code;
        }

        public static CityEnum codeOf(int code){
            for(CityEnum cityEnum : values()){
                if(cityEnum.getCode() == code){
                    return cityEnum;
                }
            }
            throw new RuntimeException("没有找到对应的枚举");
        }
    }



}
